package com.loyal.loyalerp.humenresource.employee.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.loyal.loyalerp.basedata.department.model.Department;
import com.loyal.loyalerp.humenresource.employee.data.Gy_PersonData;
import com.loyal.loyalerp.humenresource.employee.data.vo.Gy_PersonVo;
import com.loyal.loyalerp.humenresource.employee.entity.Gy_Person;

@Mapper
public interface Gy_PersonMapper {
	    
	    //判断工号有没有重复
	    int selectPersonCodeHasExist(String personCode);
	
		@Select("select * from gy_person where active=#{active}")
		List<Gy_Person> selectByActive(Byte active);
	
		@Select("select * from gy_person")
		List<Gy_Person> listPerson();
	
	    int deleteByPrimaryKey(Long id);

	    int insert(Gy_Person record);

	    int insertSelective(Gy_Person record);

	    Gy_Person selectByPrimaryKey(Long id);

	    int updateByPrimaryKeySelective(Gy_Person record);

	    int updateByPrimaryKey(Gy_Person record);
	    //列出所有的员工信息
	    List<Gy_PersonData> selectAllPerson();
	    
	    int updateByActive(Gy_Person record);
	    
	    List<Map<String, Object>> selectCompanyNameWithId(Department record);
	    
	    int updateById(Gy_PersonVo record);
	    
	    int selectPersonIdByUserId(int userId);

		List<Gy_Person> selectByPCD(@Param("active") Byte activeByte,@Param("pname") String pname,@Param("companyid") Integer companyid,@Param("deptid") Integer deptid);

}
